#ifndef GLOBALHOTKEY_H
#define GLOBALHOTKEY_H

#include <QApplication>
#include <windows.h>
#include "stockanalyzer.h"

class GlobalHotkey : public QApplication
{
    Q_OBJECT
public:
    GlobalHotkey(int &argc, char **argv);
    ~GlobalHotkey();

    bool registerHotKey(StockAnalyzer *window);
    void unregisterHotKey(StockAnalyzer *window);

signals:
    void signalPressedHotkey(int);

public slots:
    void slotUnregisterHotKey();

protected:
    bool winEventFilter(MSG *msg, long *result);

private:
    int m_atom;
    int m_hk;

    StockAnalyzer *m_pStockAnalyzer;
};

#endif // GLOBALHOTKEY_H
